Method for synthesizing image based on conditional generative adversarial network and related device

ABSTRACT

A method includes: obtaining a plurality of clinical red blood cell images, dividing red blood cells of different shapes at different positions in each of the red blood cell images into a plurality of submasks, and synthesizing the submasks corresponding to each of the red blood cell images to generate one mask to obtain a plurality of masks corresponding to the red blood cell images; collecting shape data of a plurality of red blood cells from the masks to obtain a training data set, calculating a segmentation boundary of each red blood cell in the training data set, and establishing a red blood cell shape data set based on the segmentation boundary of each red blood cell; collecting distribution data of each red blood cell in the red blood cell shape data set; and synthesizing the red blood cell shape data set into a plurality of red blood cell images.

CROSS REFERENCE TO THE RELATED APPLICATIONS

This application is the national stage entry of InternationalApplication No. PCT/CN2019/117988, filed on Nov. 13, 2019, which isbased upon and claims priority to Chinese Patent Application No.201910741020.7, filed on Aug. 12, 2019, the entire contents of which areincorporated herein by reference.

TECHNICAL FIELD

This application relates to the neural network field, and in particular,to a method for synthesizing an image based on a conditional generativeadversarial network and a related device.

BACKGROUND

In the medical field, it is necessary to collect a large amount ofclinical data, mark the clinical data separately, and perform deeplearning on the marked clinical data. Since marking data requiresprofessional medical knowledge, the requirements for the markingoperation are high. The inventor realizes that if clinical data is to beused and shared, it needs to be authorized by a plurality of partiessuch as patients, doctors, and hospitals, which is difficult toimplement. In addition, before deep learning is performed on theclinical data, it is further necessary to perform compatible processingand data conversion on clinical data of different medical institutions.The operation is cumbersome and time-consuming.

SUMMARY

This application provides a method for synthesizing an image based on aconditional generative adversarial network and a related device, so asto solve the prior-art problem that processing of clinical data ofdifferent medical institutions is cumbersome.

According to a first aspect, this application provides a method forsynthesizing an image based on a conditional generative adversarialnetwork. The method includes:

obtaining a plurality of clinical red blood cell images, dividing redblood cells of different shapes at different positions in each of thered blood cell images into a plurality of submasks, and synthesizing theplurality of submasks corresponding to each of the red blood cell imagesto generate one mask, so as to obtain a plurality of masks correspondingto the plurality of red blood cell images, where each of the red bloodcell images includes a plurality of red blood cells, and shapes andpositions of the red blood cells on the same red blood cell image may bethe same or different;

collecting shape data of a plurality of red blood cells from theplurality of masks to obtain a training data set, calculating asegmentation boundary of each red blood cell in the training data set,and establishing a red blood cell shape data set based on thesegmentation boundary of each red blood cell, where the red blood cellshape data set is used to provide shape data of red blood cells duringsynthesis of a red blood cell image;

collecting distribution data of each red blood cell in the red bloodcell shape data set; and

synthesizing the red blood cell shape data set into a plurality of redblood cell images.

According to a second aspect, this application provides an apparatus forsynthesizing an image, where the apparatus has a function ofimplementing the method for synthesizing an image based on a conditionalgenerative adversarial network provided in the first aspect. Thefunction may be implemented by hardware, or may be implemented byhardware executing corresponding software. The hardware or the softwareincludes one or more modules corresponding to the function, and themodule may be software and/or hardware.

In a possible design, the apparatus includes:

an input/output module, configured to obtain a plurality of clinical redblood cell images, divide red blood cells of different shapes atdifferent positions in each of the red blood cell images into aplurality of submasks, and synthesize the plurality of submaskscorresponding to each of the red blood cell images to generate one mask,so as to obtain a plurality of masks corresponding to the plurality ofred blood cell images, where each of the red blood cell images includesa plurality of red blood cells, and shapes and positions of the redblood cells on the same red blood cell image may be the same ordifferent; and

a processing module, configured to collect shape data of a plurality ofred blood cells from the plurality of masks by using the input/outputmodule to obtain a training data set, calculate a segmentation boundaryof each red blood cell in the training data set, and establish a redblood cell shape data set based on the segmentation boundary of each redblood cell, where the red blood cell shape data set is used to provideshape data of red blood cells during synthesis of a red blood cellimage; collect distribution data of each red blood cell in the red bloodcell shape data set by using the input/output module; and synthesize thered blood cell shape data set into a plurality of red blood cell images.

A third aspect of this application provides a computer device, where thecomputer device includes at least one connected processor, a memory, anda transceiver, the memory is configured to store program code, and theprocessor is configured to invoke the program code in the memory toperform the method according to the first aspect.

A fourth aspect of this application provides a computer storage medium,where the storage medium stores a computer instruction, and when thecomputer instruction runs on a computer, the computer is enabled toperform the method according to the first aspect.

Compared with the prior art, in the solution provided in thisapplication, a plurality of clinical red blood cell images are obtained,red blood cells of different shapes at different positions in each ofthe red blood cell images are divided into a plurality of submasks, andthe plurality of submasks corresponding to each of the red blood cellimages are synthesized to generate one mask, so as to obtain a pluralityof masks corresponding to the plurality of red blood cell images; shapedata of a plurality of red blood cells is collected from the pluralityof masks to obtain a training data set, a segmentation boundary of eachred blood cell in the training data set is calculated, and a red bloodcell shape data set is established based on the segmentation boundary ofeach red blood cell; distribution data of each red blood cell in the redblood cell shape data set is collected; and the red blood cell shapedata set is synthesized into a plurality of red blood cell images. Inthis solution, existing clinical data can be simulated and augmentedwhen a large amount of real clinical data is lacking.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic flowchart of a method for synthesizing an imagebased on a conditional generative adversarial network according to anembodiment of this application;

FIG. 2 is a schematic structural diagram of an apparatus 20 forsynthesizing an image according to an embodiment of this application;and

FIG. 3 is a schematic structural diagram of a computer device accordingto an embodiment of this application.

DETAILED DESCRIPTION OF THE EMBODIMENTS

It should be understood that the specific embodiments described hereinare merely used to explain this application but are not intended tolimit this application. In the specification, claims, and accompanyingdrawings of this application, the terms “first”, “second”, and the likeare intended to distinguish between similar objects but do notnecessarily indicate a specific order or sequence. It should beunderstood that the terms used in such a way are interchangeable inproper circumstances so that the embodiments of this applicationdescribed herein can be implemented in other orders than the orderillustrated or described herein. In addition, the terms “include”,“have”, or any other variant thereof are intended to cover anon-exclusive inclusion. For example, a process, a method, a system, aproduct, or a device that includes a series of steps or modules is notnecessarily limited to the steps or modules that are expressly listed,but may include another step or module not expressly listed or inherentto the process, the method, the product, or the device. The moduledivision in this application is merely logical division, and there maybe another division during implementation in actual application. Forexample, a plurality of modules may be combined or integrated intoanother system, or some features may be ignored or not performed.

This application provides a method for synthesizing an image based on aconditional generative adversarial network, and a related device, whichcan be applied to a feature encoder network.

To solve the foregoing technical problem, this application mainlyprovides the following technical solutions:

A new red blood cell image is synthesized based on a conditionalgenerative adversarial nets (CGAN) algorithm, achieving dataaugmentation to meet deep learning needs. To synthesize a new red bloodcell image, a mask needs to be first generated through synthesis, andthe generated mask is then converted into a realistic image.

Referring to FIG. 1, the following describes a method for synthesizingan image based on a conditional generative adversarial network accordingto an embodiment of this application. The method includes:

101. Obtain a plurality of clinical red blood cell images, divide redblood cells of different shapes at different positions in each of thered blood cell images into a plurality of submasks, and synthesize theplurality of submasks corresponding to each of the red blood cell imagesto generate one mask, so as to obtain a plurality of masks correspondingto the plurality of red blood cell images.

Each of the red blood cell images includes a plurality of red bloodcells, and shapes and positions of the red blood cells on the same redblood cell image may be the same or different.

In some implementations, the synthesizing the plurality of submaskscorresponding to each of the red blood cell images to generate one mask,so as to obtain a plurality of masks corresponding to the plurality ofred blood cell images includes:

invoking a red blood cell shape sampler to iteratively select a redblood cell shape s_(i) from the red blood cell shape data set, where1≤i≤n and i is a positive integer; and

placing the selected red blood cell shape s in the submasks to obtainthe mask.

Specifically, the red blood cells of different shapes at differentpositions are used to generate a synthesized instance segmentation mask,that is, the mask. To be specific, the shape of the red blood cell andthe position of the red blood cell in the red blood cell image areobtained, and an expression of the mask obtained after synthesis is asfollows:

({(s ₁ ,l ₁),s ₂ ,l ₂), . . . ,(s _(n) ,l _(n)),background}  (1)

where, s₁, s₂, . . . , and s_(n) all represent the shapes of red bloodcells, l_(n) represents the positions of red blood cells in a red bloodcell image, (s_(n),l_(n)) represents a submask, n represents the totalnumber of red blood cells in a red blood cell image, n is a positiveinteger, and background represents a background pixel image of the redblood cell image.

The shapes of red blood cells, the total number of red blood cells in ared blood cell image, and the positions of red blood cells in a redblood cell image are normally distributed, and an expression of thenormal distribution is n˜Norm(μ_(n),σ_(n)), where μ_(n) and σ_(n) aredetermined by the training set.

Optionally, when s_(i) is selected, a probability density function canbe used to select s_(i). The probability density function can be used tocalculate a set of probabilities. The set of probabilities is used toenhance appearance features of red blood cell shapes s_(i), for example,enriching the appearance of red blood cells, including rotation,zooming, horizontal/vertical flipping, etc.

102. Collect shape data of a plurality of red blood cells from theplurality of masks to obtain a training data set, calculate asegmentation boundary of each red blood cell in the training data set,and establish a red blood cell shape data set based on the segmentationboundary of each red blood cell.

The red blood cell shape data set is used to provide shape data of redblood cells during synthesis of a red blood cell image.

In some implementations, the collecting shape data of a plurality of redblood cells from the plurality of masks to obtain a training data set,calculating a segmentation boundary of each red blood cell in thetraining data set, and establishing a red blood cell shape data setbased on the segmentation boundary of each red blood cell includes:

identifying a discontinuous background region in a background imagethrough image segmentation, marking the discontinuous background region,and determining a segmentation threshold;

performing edge detection on cell membranes of red blood cells in eachred blood cell image region by using an edge detection method, to obtainan 8-connected edge of a single pixel in each red blood cell imageregion;

comparing the segmentation threshold with a grayscale value of a pixel,performing pixel segmentation on the red blood cell image based on thesegmentation threshold to obtain a plurality of red blood cell imageregions, and performing grayscale stretching on the 8-connected edge ofa single pixel in each red blood cell image region to segment the redblood cell image background and the grayscale value of the 8-connectededge of a single pixel to obtain a binary image;

performing a fill operation on the binary image to fill the interior ofeach red blood cell in the binary image; and

performing canny edge detection on the filled binary image to obtain asegmentation boundary (which may also be referred to as a contour) ofeach red blood cell.

When grayscale stretching is performed on the 8-connected edge of asingle pixel in each red blood cell image region, the followingconversion formula is used to segment the red blood cell imagebackground and the grayscale value of the 8-connected edge of a singlepixel to obtain the binary image:

${g\left( {i,j} \right)} = \left\{ \begin{matrix}{1,} & {{f\left( {i,j} \right)} \geq T} \\{0,} & {{f\left( {i,j} \right)} < T}\end{matrix} \right.$

where, T represents the segmentation threshold, f(i,j) represents aninput red blood cell image, and g(i,j) represents an output red bloodcell image. When the red blood cell image is segmented, for the pixelsin the red blood cell region, g(i,j)=1, and for the pixels in thebackground region, g(i,)=0.

Optionally, the segmentation boundaries of all red blood cells can alsobe extracted for size judging. If the segmentation boundary is less thana preset threshold, it is considered that a red blood cell whosesegmentation boundary is less than the preset threshold is not a redblood cell.

It can be learned from the foregoing description that filling theinteriors of the red blood cells in the middle can avoid double edges ofthe red blood cells inside; filling the interior of each red blood cellin the binary image can avoid double edges of the red blood cellsinside.

103. Collect distribution data of each red blood cell in the red bloodcell shape data set.

In some implementations, an estimation of distribution algorithm may beused to separately collect a position of each red blood cell in a canvasin a probability density function in two-dimensional discrete space.

Specifically, the collecting distribution data of each red blood cell inthe red blood cell shape data set includes:

using the estimation of distribution algorithm to locate the position ofeach red blood cell in the red blood cell shape data set and theposition of each pixel in each red blood cell;

separately calculating, based on the probability density function, theposition of each red blood cell and the position of each pixel, a priorprobability of each pixel being selected as a red blood cell center;

generating a possibility image set P(i) corresponding to each red bloodcell from the prior probability of each pixel being selected as a redblood cell center and each red blood cell;

sequentially selecting a prior probability from the possibility imageset P(i) based on the value of i in ascending order, and simulating areal adhesion state of red blood cells for each value of i; and

calculating the distribution data of each red blood cell in the redblood cell shape data set based on the position of each red blood celland the position of each pixel in the real adhesion state of red bloodcells simulated for each value of i.

Optionally, the probability density function is represented by apossibility image set P(i), and a formula for collecting a position 1,of an i-th red blood cell from the possibility image set P(i) is asfollows:

l _(i) ˜P(i)  (2)

where, the value of each pixel in P(i) refers to a prior probability ofthe pixel being selected as the red blood cell center in an i-th step.When the first n_(init) cell is extracted, P(i) is initially uniform.When i increases, P(i) changes the shape. Positions 1, of red bloodcells of different shapes are extracted from P(i) at a time by usingformula (2) based on the value of i in descending order. Therefore, theentire process of extracting red blood cells from P(i) can simulate thereal adhesion state of red blood cells. In some implementations, theMarkov stochastic process can be used to simulate natural evolution ofP(i). An expression is as follows:

$\begin{matrix}{{\mathcal{P}(i)} = \left\{ \begin{matrix}{{uniform},} & {i \leq n_{init}} \\{{\left( {1 - a_{i}} \right){\mathcal{P}\left( {i - 1} \right)}} + {a_{i}{z\left( l_{i - 1} \right)}}} & {i > n_{init}}\end{matrix} \right.} & (3)\end{matrix}$

An excitation function z(l_(i)) surrounds a collected cell center l_(i)and is calculated according to a two-dimensional Gaussian function(σ=σx=σy). A purpose of this step is to reduce the possibility ofboundaries of red blood cells that have been allocated, so as to preventred blood cells from overlapping. An amount of increments depends on astandard coefficient a_(i) (ai=1/i). At any time point, the sum of P(i)is 1.

In fact, when red blood cells are located in the synthesized mask, thered blood cells are always on the canvas of the synthesized mask at anytime. Therefore, a color can be given to make the red blood cells incontact have different colors. If this condition cannot be met, thecoordinate collection process is repeated. Since the colors of red bloodcells in contact are different, the generated synthesized mask can beused as an instance segmentation mask with the possibility of extractingeach red blood cell.

104. Synthesize the red blood cell shape data set into a plurality ofred blood cell images.

In this application, a generator G for generating red blood cell imagesand two multi-scale discriminators (referred to as D1 and D2 for short)are provided in a feature encoder network E.

In some implementations, the synthesizing the red blood cell shape dataset into a plurality of red blood cell images includes:

inputting the red blood cell shape data set into the generator G;

the generator G converts the segmentation mask in the red blood cellshape data set into a plurality of red blood cell images, and inputs theplurality of red blood cell images obtained through the conversion intothe two multi-scale discriminators D, where the plurality of red bloodcell images obtained through the conversion are all images that simulaterealistic red blood cells;

the two multi-scale discriminators D perform discrimination at leastonce between the real red blood cell image and the synthesized red bloodcell image within a preset period of time, so as to train a neuralnetwork model;

the two multi-scale discriminators D output training results;

a feature encoder network E combines the training results with the redblood cell shape data set x to obtain a combined result, where thecombined result is used to control the style of synthesizing the redblood cell image;

inputting the plurality of masks into the generator at the stage ofsynthesizing the red blood cell image; and

the generator synthesizes the plurality of masks into the red blood cellimage; where the combined result can be obtained by using a K-meansclustering algorithm to generate a plurality of clusters, such as 10clusters, from the training results and the red blood cell shape dataset. The style of the red blood cell image obtained through thesynthesis is determined by the encoder E based on randomly collectedfeatures of the plurality of clusters.

In some implementations, a complete network training target is asfollows:

$\min\limits_{G}\left( {\left( {\max\limits_{D_{1},D_{2}}{\sum\limits_{{k = 1},2}{L_{GAN}\left( {G,D_{k}} \right)}}} \right) + {\lambda_{FM}{\sum\limits_{{k = 1},2}{L_{FM}\left( {G,D_{k}} \right)}}} + {\lambda_{PR}{L_{PR}\left( {{G\left( {x,{E(x)}} \right)},y} \right)}}} \right)$

where, x represents the red blood cell shape data set, LGAN(G, Dk)represents an adversarial loss, and an expression of the adversarialloss is as follows:

E _((x,y))[log D _(k)(x,y)]+E _(x)[log(1−D _(k)(x,G(x,E(x)))]

LFM(G; Dk) represents a feature matching loss, and the feature matchingloss is used to stabilize the training results and produce better visualresults on a plurality of scales. An expression of the feature matchingloss is as follows:

$E_{({x,y})}{\sum\limits_{i = 1}^{T}{\frac{1}{N_{i}}\left\lbrack {{{{D_{k}^{(i)}\left( {x,y} \right)} - {D_{k}^{(i)}\left( {x,{G\left( {x,{E(x)}} \right)}} \right)}}}1} \right\rbrack}}$

LPR(G(x); y) represents a perceptual reconstruction loss, and theperceptual reconstruction loss is used to further improve quality of asynthesized image. An expression of the perceptual reconstruction lossis as follows:

$\sum\limits_{i = 1}^{N}{\frac{1}{M_{i}}\left\lbrack {{{{F^{(i)}(y)} - {F^{(i)}\left( {x,{G\left( {x,{E(x)}} \right)}} \right)}}}1} \right\rbrack}$

Compared with the existing mechanism, in the embodiments of thisapplication, when a large amount of real clinical data is lacking, datasimulation and augmentation of existing clinical data can also beperformed to generate realistic clinical data, and then deep learning isperformed based on the simulated and augmented clinical data, therebybreaking the format compatibility limitations of different data sourcesand meeting the needs of deep learning.

The technical features mentioned in the embodiment or implementationcorresponding to FIG. 1 are also applicable to embodiments correspondingto FIG. 2 and FIG. 3 in this application. Similar content is notdescribed below.

The foregoing describes the method for synthesizing an image based on aconditional generative adversarial network in this application. Thefollowing describes an apparatus for performing the method forsynthesizing an image based on a conditional generative adversarialnetwork.

FIG. 2 is a schematic structural diagram of an apparatus 20 forsynthesizing an image. The apparatus 20 can be used to recognize a redblood cell image. The apparatus 20 in an embodiment of this applicationcan implement the steps corresponding to the method for synthesizing animage based on a conditional generative adversarial network performed inthe embodiment corresponding to FIG. 1. The function implemented by theapparatus 20 may be implemented by hardware, or may be implemented byhardware by executing corresponding software. The hardware or thesoftware includes one or more modules corresponding to the function, andthe module may be software and/or hardware. The apparatus 20 may includean input/output module 201 and a processing module 202. Forimplementation of functions of the processing module 202 and theinput/output module 201, reference can be made to the operationsperformed in the embodiment corresponding to FIG. 1, and details are notdescribed herein. The processing module 202 can be configured to controlinput/output or receiving and sending operations of the input/outputmodule 201.

In some implementations, the input/output module 201 can be configuredto obtain a plurality of clinical red blood cell images, divide redblood cells of different shapes at different positions in each of thered blood cell images into a plurality of submasks, and synthesize theplurality of submasks corresponding to each of the red blood cell imagesto generate one mask, so as to obtain a plurality of masks correspondingto the plurality of red blood cell images, where each of the red bloodcell images includes a plurality of red blood cells, and shapes andpositions of the red blood cells on the same red blood cell image may bethe same or different; and

the processing module 202 can be configured to collect shape data of aplurality of red blood cells from the plurality of masks by using theinput/output module to obtain a training data set, calculate asegmentation boundary of each red blood cell in the training data set,and establish a red blood cell shape data set based on the segmentationboundary of each red blood cell, where the red blood cell shape data setis used to provide shape data of red blood cells during synthesis of ared blood cell image; collect distribution data of each red blood cellin the red blood cell shape data set by using the input/output module;and synthesize the red blood cell shape data set into a plurality of redblood cell images.

In some implementations, the processing module is specificallyconfigured to:

invoke a red blood cell shape sampler to iteratively select a red bloodcell shape s_(i) from the red blood cell shape data set, where 1≤i≤n andi is a positive integer, and s_(i) represents red blood cells ofdifferent shapes at different positions; and

place the selected red blood cell shape s_(i) in the submasks to obtainthe red blood cell shape and the position of the red blood cell in thered blood cell image, and use the obtained red blood cell shape and theobtained position of the red blood cell in the red blood cell image asthe mask; where an expression of the mask is as follows:

{(s ₁ ,l _(i)),(s ₂ ,l ₂), . . . ,(s _(n) ,l _(n)),background}

where, s₁, s₂, . . . , and s_(n) all represent the shapes of red bloodcells, l_(n) represents the positions of red blood cells in a red bloodcell image, (s_(n),l_(n)) represents a submask, n represents the totalnumber of red blood cells in a red blood cell image, n is a positiveinteger, and background represents a background pixel image of the redblood cell image.

In some implementations, the processing module is specificallyconfigured to:

identify a discontinuous background region in a background image throughimage segmentation, mark the discontinuous background region, anddetermine a segmentation threshold;

perform edge detection on cell membranes of red blood cells in each redblood cell image region by using an edge detection method, to obtain an8-connected edge of a single pixel in each red blood cell image region;

compare the segmentation threshold with a grayscale value of a pixel,perform pixel segmentation on the red blood cell image based on thesegmentation threshold to obtain a plurality of red blood cell imageregions, and perform grayscale stretching on the 8-connected edge of asingle pixel in each red blood cell image region to segment the redblood cell image background and the grayscale value of the 8-connectededge of a single pixel to obtain a binary image;

perform a fill operation on the binary image to fill the interior ofeach red blood cell in the binary image; and

perform canny edge detection on the filled binary image to obtain asegmentation boundary of each red blood cell; where

when grayscale stretching is performed on the 8-connected edge of asingle pixel in each red blood cell image region, the followingconversion formula is used to segment the red blood cell imagebackground and the grayscale value of the 8-connected edge of a singlepixel to obtain the binary image g(i,j):

${g\left( {i,j} \right)} = \left\{ \begin{matrix}{1,} & {{f\left( {i,j} \right)} \geq T} \\{0,} & {{f\left( {i,j} \right)} < T}\end{matrix} \right.$

where, T represents the segmentation threshold, f(i,j) represents aninput red blood cell image, and g(i,j) represents an output red bloodcell image.

In some implementations, the processing module is specificallyconfigured to:

use an estimation of distribution algorithm to locate the position ofeach red blood cell in the red blood cell shape data set and theposition of each pixel in each red blood cell;

separately calculate, based on the probability density function, theposition of each red blood cell and the position of each pixel, a priorprobability of each pixel being selected as a red blood cell center;

generate a possibility image set P(i) corresponding to each red bloodcell from the prior probability of each pixel being selected as a redblood cell center and each red blood cell;

sequentially select a prior probability from the possibility image setP(i) based on the value of i in ascending order, and simulate a realadhesion state of red blood cells for each value of i; and

calculate the distribution data of each red blood cell in the red bloodcell shape data set based on the position of each red blood cell and theposition of each pixel in the real adhesion state of red blood cellssimulated for each value of i.

In some implementations, the processing module is specificallyconfigured to:

input the red blood cell shape data set into a generator G;

convert, by the generator G, the segmentation mask in the red blood cellshape data set into a plurality of red blood cell images, and input theplurality of red blood cell images obtained through the conversion intotwo multi-scale discriminators D, where the plurality of red blood cellimages obtained through the conversion are all images that simulaterealistic red blood cells;

perform, by the two multi-scale discriminators D, discrimination atleast once between the real red blood cell image and the synthesized redblood cell image within a preset period of time, so as to train a neuralnetwork model;

output, by the two multi-scale discriminators D, training results;

combine, by a feature encoder network E, the training results with thered blood cell shape data set x to obtain a combined result, where thecombined result is used to control a style of synthesizing the red bloodcell image; the combined result can be obtained by using a K-meansclustering algorithm to generate a plurality of clusters from thetraining results and the red blood cell shape data set; the style of thered blood cell image obtained through the synthesis is determined by theencoder E based on randomly collected features of the plurality ofclusters;

input the plurality of masks into the generator by using theinput/output module at the stage of synthesizing the red blood cellimage; and

synthesize, by the generator, the plurality of masks into the red bloodcell image.

A physical device corresponding to the input/output module 201 shown inFIG. 2 is an input/output unit shown in FIG. 3. The input/output unitcan implement some or all of functions of an acquisition module 1, orimplement functions the same as or similar to those of the input/outputmodule 201.

A physical device corresponding to the processing module 202 shown inFIG. 2 is a processor shown in FIG. 3. The processor can implement someor all of the functions of the processing module 202, or implementfunctions the same as or similar to those of the processing module 202.

The foregoing separately describes the apparatus 20 in the embodiment ofthis application from the perspective of modular functional entities.The following describes a computer device from the perspective ofhardware, as shown in FIG. 3. The computer device includes: a processor,a memory, a transceiver (which may also be an input/output unit, notshown in FIG. 3), and a computer program that is stored in the memoryand that can run on the processor. For example, the computer program maybe a program corresponding to the method for synthesizing an image basedon a conditional generative adversarial network in the embodimentcorresponding to FIG. 1. For example, when the computer deviceimplements the functions of the apparatus 20 shown in FIG. 2, theprocessor executes the computer program to implement the steps of themethod for synthesizing an image based on a conditional generativeadversarial network performed by the apparatus 20 in the embodimentcorresponding to FIG. 2; or the processor executes the computer programto implement the functions of various modules in the apparatus 20 in theembodiment corresponding to FIG. 2. For another example, the computerprogram may be a program corresponding to the method for synthesizing animage based on a conditional generative adversarial network in theembodiment corresponding to FIG. 1.

This application further provides a computer-readable storage medium.The computer-readable storage medium may be a non-volatilecomputer-readable storage medium, or may be a volatile computer-readablestorage medium. The computer-readable storage medium stores a computerinstruction, and when the computer instruction runs on a computer, thecomputer is enabled to perform the following steps:

obtaining a plurality of clinical red blood cell images, dividing redblood cells of different shapes at different positions in each of thered blood cell images into a plurality of submasks, and synthesizing theplurality of submasks corresponding to each of the red blood cell imagesto generate one mask, so as to obtain a plurality of masks correspondingto the plurality of red blood cell images, where each of the red bloodcell images includes a plurality of red blood cells, and shapes andpositions of the red blood cells on the same red blood cell image may bethe same or different;

collecting shape data of a plurality of red blood cells from theplurality of masks to obtain a training data set, calculating asegmentation boundary of each red blood cell in the training data set,and establishing a red blood cell shape data set based on thesegmentation boundary of each red blood cell, where the red blood cellshape data set is used to provide shape data of red blood cells duringsynthesis of a red blood cell image;

collecting distribution data of each red blood cell in the red bloodcell shape data set; and

synthesizing the red blood cell shape data set into a plurality of redblood cell images.

From the foregoing descriptions of the implementations, a person skilledin the art can clearly understand that the method in the embodiments maybe implemented by software and a necessary universal hardware platform,and certainly may alternatively be implemented by hardware. However, inmany cases, the implementation performed by software and a necessaryuniversal hardware platform is better. Based on such an understanding,the technical solutions of this application essentially or the partcontributing to the prior art may be implemented in a form of a softwareproduct. The computer software product is stored in a storage medium(for example, a ROM/RAM), and includes several instructions forinstructing a terminal (which may be a mobile phone, a computer, aserver, a network device, or the like) to perform the methods describedin the embodiments of this application.

The embodiments of this application are described with reference to theaccompanying drawings above. However, this application is not limited tothe foregoing specific implementations, which are merely examples butnot limitations. A person of ordinary skill in the art may make manyforms under the teaching of this application without departing from thepurpose of this application and the protection scope of the claims. Allof equivalent structures or equivalent process variations made by usingthe specification and the accompanying drawings of this application, orthose directly or indirectly applied in other related technical fieldsshall fall within the protection scope of this application.

1. A method for synthesizing an image based on a conditional generativeadversarial network, comprising: obtaining a plurality of clinical redblood cell images, dividing red blood cells of different shapes atdifferent positions in each of the plurality of clinical red blood cellimages into a plurality of submasks, and synthesizing the plurality ofsubmasks corresponding to each of the plurality of clinical red bloodcell images to generate one mask, and to obtain a plurality of maskscorresponding to the plurality of red blood cell images, wherein each ofthe plurality of clinical red blood cell images comprises a plurality ofred blood cells, and shapes and positions of the plurality of red bloodcells on the same red blood cell image are identical or different;collecting shape data of the plurality of red blood cells from theplurality of masks to obtain a training data set, calculating asegmentation boundary of each red blood cell in the training data set,and establishing a red blood cell shape data set based on thesegmentation boundary of the each red blood cell, wherein the red bloodcell shape data set is used to provide the shape data of the pluralityof red blood cells during synthesis of a red blood cell image;collecting distribution data of the each red blood cell in the red bloodcell shape data set; and synthesizing the red blood cell shape data setinto a plurality of red blood cell images.
 2. The method according toclaim 1, wherein the step of synthesizing the plurality of submaskscorresponding to each of the plurality of clinical red blood cell imagesto generate one mask, and to obtain the plurality of masks correspondingto the plurality of red blood cell images comprises: invoking a redblood cell shape sampler to iteratively select a red blood cell shapes_(i) from the red blood cell shape data set, wherein 1≤i≤n and i is apositive integer, and s_(i) represents red blood cells of differentshapes at different positions; and placing the selected red blood cellshape s_(i) in the submasks to obtain the red blood cell shape and aposition of the red blood cell in the red blood cell image, and usingthe obtained red blood cell shape and the position of the red blood cellin the red blood cell image as the mask; wherein an expression of themask is as follows:{(s ₁ ,l ₁),(s ₂ ,l ₂), . . . ,(s _(n) ,l _(n)),background} wherein, s₁,s₂, . . . , and s_(n) all represent the shapes of the plurality of redblood cells, l_(n) represents the positions of the plurality of redblood cells in the red blood cell image, (s_(n),l_(n)) represents asubmask, n represents the total number of the plurality of red bloodcells in the background red blood cell image, n is a positive integer,and represents a background pixel image of the red blood cell image. 3.The method according to claim 1, wherein the step of collecting theshape data of the plurality of red blood cells from the plurality ofmasks to obtain the training data set, calculating the segmentationboundary of the each red blood cell in the training data set, andestablishing the red blood cell shape data set based on the segmentationboundary of the each red blood cell comprises: identifying adiscontinuous background region in a background image through imagesegmentation, marking the discontinuous background region, anddetermining a segmentation threshold; performing edge detection on cellmembranes of the plurality of red blood cells in each red blood cellimage region by using an edge detection method, to obtain an 8-connectededge of a single pixel in the each red blood cell image region;comparing the segmentation threshold with a grayscale value of a pixel,performing pixel segmentation on the red blood cell image based on thesegmentation threshold to obtain a plurality of red blood cell imageregions, and performing grayscale stretching on the 8-connected edge ofthe single pixel in the each red blood cell image region to segment ared blood cell image background and a grayscale value of the 8-connectededge of the single pixel to obtain a binary image; performing a filloperation on the binary image to fill an interior of the each red bloodcell in the binary image to obtain a filled binary image; and performingcanny edge detection on the filled binary image to obtain thesegmentation boundary of the each red blood cell; wherein when grayscalestretching is performed on the 8-connected edge of the single pixel inthe each red blood cell image region, the following conversion formulais used to segment the red blood cell image background and the grayscalevalue of the 8-connected edge of the single pixel to obtain the binaryimage g(i,j): ${g\left( {i,j} \right)} = \left\{ {\begin{matrix}{1,} & {{f\left( {i,j} \right)} \geq T} \\{0,} & {{f\left( {i,j} \right)} < T}\end{matrix},} \right.$ wherein, T represents the segmentationthreshold, f(i,j) represents an input red blood cell image, and g(i,j)represents an output red blood cell image.
 4. The method according toclaim 1, wherein the step of collecting the distribution data of theeach red blood cell in the red blood cell shape data set comprises:using an estimation of distribution algorithm to locate the position ofthe each red blood cell in the red blood cell shape data set and aposition of each pixel in the each red blood cell; based on aprobability density function, the position of the each red blood celland the position of the each pixel, calculating a prior probability thatthe each pixel is selected as a red blood cell center; generating apossibility image set P(i) corresponding to the each red blood cell fromthe prior probability that the each pixel is selected as the red bloodcell center and the each red blood cell; sequentially selecting theprior probability from the possibility image set P(i) based on the valueof i in ascending order, and simulating a real adhesion state of redblood cells for each value of i; and calculating the distribution dataof the each red blood cell in the red blood cell shape data set based onthe position of the each red blood cell and the position of the eachpixel in the real adhesion state of the plurality of red blood cellssimulated for the each value of i.
 5. The method according to claim 4,wherein the step of synthesizing the red blood cell shape data set intothe plurality of red blood cell images comprises: inputting the redblood cell shape data set into a generator G; converting, by thegenerator G, the segmentation mask in the red blood cell shape data setinto the plurality of red blood cell images, and inputting the pluralityof red blood cell images obtained through the conversion into twomulti-scale discriminators D, wherein the plurality of red blood cellimages obtained through the conversion are all images that simulaterealistic red blood cells; performing, by the two multi-scalediscriminators D, discrimination at least once between a real red bloodcell image and a synthesized red blood cell image within a preset periodof time, and to train a neural network model; outputting, by the twomulti-scale discriminators D, training results; combining, by a featureencoder network E, the training results with the red blood cell shapedata set x to obtain a combined result, wherein the combined result isused to control a style of synthesizing the red blood cell image; thecombined result is obtained by using a K-means clustering algorithm togenerate a plurality of clusters from the training results and the redblood cell shape data set; the style of synthesizing the red blood cellimage is determined by the feature encoder network E based on randomlycollected features of the plurality of clusters; inputting the pluralityof masks into the generator at a stage of synthesizing the red bloodcell image; and synthesizing, by the generator, the plurality of masksinto the red blood cell image.
 6. The method according to claim 5,wherein a complete network training target is as follows:${\min\limits_{G}\left( {\left( {\max\limits_{D_{1},D_{2}}{\sum\limits_{{k = 1},2}{L_{GAN}\left( {G,D_{k}} \right)}}} \right) + {\lambda_{FM}{\sum\limits_{{k = 1},2}{L_{FM}\left( {G,D_{k}} \right)}}} + {\lambda_{PR}{L_{PR}\left( {{G\left( {x,{E(x)}} \right)},y} \right)}}} \right)},$wherein, x represents the red blood cell shape data set,L_(GAN)(G,D_(k)) represents an adversarial loss, and an expression ofthe adversarial loss is as follows:E _((x,y))[log D _(k)(x,y)]+E _(x)[log(1−D _(k)(x,G(x,E(x)))] wherein,L_(FM)(G,D_(k)) represents a feature matching loss, the feature matchingloss is used to stabilize the training results and compensate visuallygenerated results on a plurality of scales, and an expression of thefeature matching loss is as follows:${E_{({x,y})}{\sum\limits_{i = 1}^{T}{\frac{1}{N_{i}}\left\lbrack {{{{D_{k}^{(i)}\left( {x,y} \right)} - {D_{k}^{(i)}\left( {x,{G\left( {x,{E(x)}} \right)}} \right)}}}1} \right\rbrack}}},$wherein, L_(PR)(G(x,E(x)),y) represents a perceptual reconstructionloss, and an expression of the perceptual reconstruction loss is asfollows:$\sum\limits_{i = 1}^{N}{{\frac{1}{M_{i}}\left\lbrack {{{{F^{(i)}(y)} - {F^{(i)}\left( {x,{G\left( {x,{E(x)}} \right)}} \right)}}}1} \right\rbrack}.}$7. (canceled)
 8. (canceled)
 9. (canceled)
 10. (canceled)
 11. (canceled)12. (canceled)
 13. A computer device, comprising a memory, a processor,and a computer program, wherein the computer program is stored in thememory and runs on the processor, and the processor executes thecomputer program to perform the following steps: obtaining a pluralityof clinical red blood cell images, dividing red blood cells of differentshapes at different positions in each of the plurality of clinical redblood cell images into a plurality of submasks, and synthesizing theplurality of submasks corresponding to each of the plurality of clinicalred blood cell images to generate one mask, and to obtain a plurality ofmasks corresponding to the plurality of red blood cell images, whereineach of the plurality of clinical red blood cell images comprises aplurality of red blood cells, and shapes and positions of the pluralityof red blood cells on the same red blood cell image are identical ordifferent; collecting shape data of the plurality of red blood cellsfrom the plurality of masks to obtain a training data set, calculating asegmentation boundary of each red blood cell in the training data set,and establishing a red blood cell shape data set based on thesegmentation boundary of the each red blood cell, wherein the red bloodcell shape data set is used to provide the shape data of the pluralityof red blood cells during synthesis of a red blood cell image;collecting distribution data of the each red blood cell in the red bloodcell shape data set; and synthesizing the red blood cell shape data setinto a plurality of red blood cell images.
 14. The computer deviceaccording to claim 13, wherein the processor executes the computerprogram to synthesize the plurality of submasks corresponding to each ofthe plurality of clinical red blood cell images to generate one mask,and to obtain the plurality of masks corresponding to the plurality ofred blood cell images, comprising the following steps: invoking a redblood cell shape sampler to iteratively select a red blood cell shapes_(i) from the red blood cell shape data set, wherein 1≤i≤n and i is apositive integer, and s_(i) represents red blood cells of differentshapes at different positions; and placing the selected red blood cellshape s_(i) in the submasks to obtain the red blood cell shape and aposition of the red blood cell in the red blood cell image, and usingthe obtained red blood cell shape and the position of the red blood cellin the red blood cell image as the mask; wherein an expression of themask is as follows:{(s ₁ ,l ₁),(s ₂ ,l ₂), . . . ,(s _(n) ,l _(n)),background} wherein, s₁,s₂, . . . , and s_(n) all represent the shapes of the plurality of redblood cells, l_(n) represents the positions of the plurality of redblood cells in the red blood cell image, (s_(n),l_(n)) represents asubmask, n represents the total number of the plurality of red bloodcells in the background red blood cell image, n is a positive integer,and represents a background pixel image of the red blood cell image. 15.The computer device according to claim 13, wherein the processorexecutes the computer program to collect the shape data of the pluralityof red blood cells from the plurality of masks to obtain the trainingdata set, to calculate the segmentation boundary of the each red bloodcell in the training data set, and to establish the red blood cell shapedata set based on the segmentation boundary of the each red blood cell,comprising the following steps: identifying a discontinuous backgroundregion in a background image through image segmentation, marking thediscontinuous background region, and determining a segmentationthreshold; performing edge detection on cell membranes of the pluralityof red blood cells in each red blood cell image region by using an edgedetection method, to obtain an 8-connected edge of a single pixel in theeach red blood cell image region; comparing the segmentation thresholdwith a grayscale value of a pixel, performing pixel segmentation on thered blood cell image based on the segmentation threshold to obtain aplurality of red blood cell image regions, and performing grayscalestretching on the 8-connected edge of the single pixel in the each redblood cell image region to segment a red blood cell image background anda grayscale value of the 8-connected edge of the single pixel to obtaina binary image; performing a fill operation on the binary image to fillan interior of the each red blood cell in the binary image to obtain afilled binary image; and performing canny edge detection on the filledbinary image to obtain the segmentation boundary of the each red bloodcell; wherein when grayscale stretching is performed on the 8-connectededge of the single pixel in the each red blood cell image region, thefollowing conversion formula is used to segment the red blood cell imagebackground and the grayscale value of the 8-connected edge of the singlepixel to obtain the binary image g(i,j):${g\left( {i,j} \right)} = \left\{ {\begin{matrix}{1,} & {{f\left( {i,j} \right)} \geq T} \\{0,} & {{f\left( {i,j} \right)} < T}\end{matrix},} \right.$ wherein, T represents the segmentationthreshold, f(i,j) represents an input red blood cell image, and g(i,j)represents an output red blood cell image.
 16. The computer deviceaccording to claim 13, wherein the processor executes the computerprogram to collect the distribution data of the each red blood cell inthe red blood cell shape data set, comprising the following steps: usingan estimation of distribution algorithm to locate the position of theeach red blood cell in the red blood cell shape data set and a positionof each pixel in the each red blood cell; based on a probability densityfunction, the position of the each red blood cell and the position ofthe each pixel, calculating a prior probability that the each pixel isselected as a red blood cell center; generating a possibility image setP(i) corresponding to the each red blood cell from the prior probabilitythat the each pixel is being-selected as the red blood cell center andthe each red blood cell; sequentially selecting the prior probabilityfrom the possibility image set P(i) based on the value of i in ascendingorder, and simulating a real adhesion state of red blood cells for eachvalue of i; and calculating the distribution data of the each red bloodcell in the red blood cell shape data set based on the position of theeach red blood cell and the position of the each pixel in the realadhesion state of the plurality of red blood cells simulated for theeach value of i.
 17. The computer device according to claim 16, whereinthe processor executes the computer program to synthesize the red bloodcell shape data set into the plurality of red blood cell images,comprising the following steps: inputting the red blood cell shape dataset into a generator G; converting, by the generator G, the segmentationmask in the red blood cell shape data set into the plurality of redblood cell images, and inputting the plurality of red blood cell imagesobtained through the conversion into two multi-scale discriminators D,wherein the plurality of red blood cell images obtained through theconversion are all images that simulate realistic red blood cells;performing, by the two multi-scale discriminators D, discrimination atleast once between a real red blood cell image and a synthesized redblood cell image within a preset period of time, and to train a neuralnetwork model; outputting, by the two multi-scale discriminators D,training results; combining, by a feature encoder network E, thetraining results with the red blood cell shape data set x to obtain acombined result, wherein the combined result is used to control a styleof synthesizing the red blood cell image; the combined result isobtained by using a K-means clustering algorithm to generate a pluralityof clusters from the training results and the red blood cell shape dataset; the style of synthesizing the red blood cell image is determined bythe feature encoder network E based on randomly collected features ofthe plurality of clusters; inputting the plurality of masks into thegenerator at a stage of synthesizing the red blood cell image; andsynthesizing, by the generator, the plurality of masks into the redblood cell image.
 18. The computer device according to claim 17, whereinthe processor executes the computer program to achieve a completenetwork training target, and the complete network training target is asfollows${\min\limits_{G}\left( {\left( {\max\limits_{D_{1},D_{2}}{\sum\limits_{{k = 1},2}{L_{GAN}\left( {G,D_{k}} \right)}}} \right) + {\lambda_{FM}{\sum\limits_{{k = 1},2}{L_{FM}\left( {G,D_{k}} \right)}}} + {\lambda_{PR}{L_{PR}\left( {{G\left( {x,{E(x)}} \right)},y} \right)}}} \right)},$wherein, x represents the red blood cell shape data set,L_(GAN)(G,D_(k)) represents an adversarial loss, and an expression ofthe adversarial loss is as follows:E _((x,y))[log D _(k)(x,y)]+E _(x)[log(1−D _(k)(x,G(x,E(x)))], wherein,L_(FM)(G,D_(k)) represents a feature matching loss, the feature matchingloss is used to stabilize the training results and compensate visuallygenerated results on a plurality of scales, and an expression of thefeature matching loss is as follows:${E_{({x,y})}{\sum\limits_{i = 1}^{T}{\frac{1}{N_{i}}\left\lbrack {{{{D_{k}^{(i)}\left( {x,y} \right)} - {D_{k}^{(i)}\left( {x,{G\left( {x,{E(x)}} \right)}} \right)}}}1} \right\rbrack}}},$wherein, L_(PR)(G(x,E(X)),y) represents a perceptual reconstructionloss, and an expression of the perceptual reconstruction loss is asfollows:$\sum\limits_{i = 1}^{N}{{\frac{1}{M_{i}}\left\lbrack {{{{F^{(i)}(y)} - {F^{(i)}\left( {x,{G\left( {x,{E(x)}} \right)}} \right)}}}1} \right\rbrack}.}$19. A computer-readable storage medium, wherein the computer-readablestorage medium stores a computer instruction, and when the computerinstruction runs on a computer, the computer is enabled to perform thefollowing steps: obtaining a plurality of clinical red blood cellimages, dividing red blood cells of different shapes at differentpositions in each of the plurality of clinical red blood cell imagesinto a plurality of submasks, and synthesizing the plurality of submaskscorresponding to each of the plurality of clinical red blood cell imagesto generate one mask, and to obtain a plurality of masks correspondingto the plurality of red blood cell images, wherein each of the pluralityof clinical red blood cell images comprises a plurality of red bloodcells, and shapes and positions of the plurality of red blood cells onthe same red blood cell image are identical or different; collectingshape data of the plurality of red blood cells from the plurality ofmasks to obtain a training data set, calculating a segmentation boundaryof each red blood cell in the training data set, and establishing a redblood cell shape data set based on the segmentation boundary of the eachred blood cell, wherein the red blood cell shape data set is used toprovide the shape data of the plurality of red blood cells duringsynthesis of a red blood cell image; collecting distribution data of theeach red blood cell in the red blood cell shape data set; andsynthesizing the red blood cell shape data set into a plurality of redblood cell images.
 20. The computer-readable storage medium according toclaim 19, wherein when the computer instruction runs on the computer,the computer is enabled to synthesize the plurality of submaskscorresponding to each of the plurality of clinical red blood cell imagesto generate one mask, and to obtain the plurality of masks correspondingto the plurality of red blood cell images, comprising the followingsteps: invoking a red blood cell shape sampler to iteratively select ared blood cell shape s_(i) from the red blood cell shape data set,wherein 1≤i≤n and i is a positive integer, and s_(i) represents redblood cells of different shapes at different positions; and placing theselected red blood cell shape s_(i) in the submasks to obtain the redblood cell shape and a position of the red blood cell in the red bloodcell image, and using the obtained red blood cell shape and the positionof the red blood cell in the red blood cell image as the mask; whereinan expression of the mask is as follows:{(s ₁ ,l ₁),(s ₂ ,l ₂), . . . ,(s _(n) ,l _(n)),background} wherein, s₁,s₂, . . . , and s_(n) all represent the shapes of the plurality of redblood cells, l_(n) represents the positions of the plurality of redblood cells in the red blood cell image, (s_(n),l_(n)) represents asubmask, n represents the total number of the plurality of red bloodcells in the background red blood cell image, n is a positive integer,and represents a background pixel image of the red blood cell image. 21.The method according to claim 3, wherein after segmenting the red bloodcell image background and the grayscale value of the 8-connected edge ofthe single pixel to obtain the binary image g(i,j), the method furthercomprises: when the red blood cell image is segmented, for pixels in ared blood cell region, setting g(i,j)=1 and for the pixels in abackground region, setting g(i,j)=0.
 22. The computer device accordingto claim 15, wherein after segmenting the red blood cell imagebackground and the grayscale value of the 8-connected edge of the singlepixel to obtain the binary image g(i,j), the processor executes thecomputer program to perform the following steps: when the red blood cellimage is segmented, for pixels in a red blood cell region, settingg(i,j)=1 and for the pixels in a background region, setting g(i,j)=0.23. The computer-readable storage medium according to claim 19, whereinwhen the computer instruction runs on the computer, the computer isconfigured to collect the shape data of the plurality of red blood cellsfrom the plurality of masks to obtain the training data set, tocalculate the segmentation boundary of the each red blood cell in thetraining data set, and to establish the red blood cell shape data setbased on the segmentation boundary of the each red blood cell,comprising the following steps: identifying a discontinuous backgroundregion in a background image through image segmentation, marking thediscontinuous background region, and determining a segmentationthreshold; performing edge detection on cell membranes of the pluralityof red blood cells in each red blood cell image region by using an edgedetection method, to obtain an 8-connected edge of a single pixel in theeach red blood cell image region; comparing the segmentation thresholdwith a grayscale value of a pixel, performing pixel segmentation on thered blood cell image based on the segmentation threshold to obtain aplurality of red blood cell image regions, and performing grayscalestretching on the 8-connected edge of the single pixel in the each redblood cell image region to segment a red blood cell image background anda grayscale value of the 8-connected edge of the single pixel to obtaina binary image; performing a fill operation on the binary image to fillan interior of the each red blood cell in the binary image to obtain afilled binary image; and performing canny edge detection on the filledbinary image to obtain the segmentation boundary of the each red bloodcell; wherein when grayscale stretching is performed on the 8-connectededge of the single pixel in the each red blood cell image region, thefollowing conversion formula is used to segment the red blood cell imagebackground and the grayscale value of the 8-connected edge of the singlepixel to obtain the binary image g(i,j):${g\left( {i,j} \right)} = \left\{ {\begin{matrix}{1,} & {{f\left( {i,j} \right)} \geq T} \\{0,} & {{f\left( {i,j} \right)} < T}\end{matrix},} \right.$ wherein, T represents the segmentationthreshold, f(i,j) represents an input red blood cell image, and g(i,j)represents an output red blood cell image.
 24. The computer-readablestorage medium according to claim 19, wherein when the computerinstruction runs on the computer, the computer is configured to collectthe distribution data of the each red blood cell in the red blood cellshape data set, comprising the following steps: using an estimation ofdistribution algorithm to locate the position of the each red blood cellin the red blood cell shape data set and a position of each pixel in theeach red blood cell; based on a probability density function, theposition of the each red blood cell and the position of the each pixel,calculating a prior probability that the each pixel is selected as a redblood cell center; generating a possibility image set P(i) correspondingto the each red blood cell from the prior probability that the eachpixel is selected as the red blood cell center and the each red bloodcell; sequentially selecting the prior probability from the possibilityimage set P(i) based on the value of i in ascending order, andsimulating a real adhesion state of red blood cells for each value of i;and calculating the distribution data of the each red blood cell in thered blood cell shape data set based on the position of the each redblood cell and the position of the each pixel in the real adhesion stateof the plurality of red blood cells simulated for the each value of i.25. The computer-readable storage medium according to claim 24, whereinwhen the computer instruction runs on the computer, the computer isconfigured to the red blood cell shape data set into the plurality ofred blood cell images, comprising—the following steps: inputting the redblood cell shape data set into a generator G; converting, by thegenerator G, the segmentation mask in the red blood cell shape data setinto the plurality of red blood cell images, and inputting the pluralityof red blood cell images obtained through the conversion into twomulti-scale discriminators D, wherein the plurality of red blood cellimages obtained through the conversion are all images that simulaterealistic red blood cells; performing, by the two multi-scalediscriminators D, discrimination at least once between a real red bloodcell image and a synthesized red blood cell image within a preset periodof time, and to train a neural network model; outputting, by the twomulti-scale discriminators D, training results; combining, by a featureencoder network E, the training results with the red blood cell shapedata set x to obtain a combined result, wherein the combined result isused to control a style of synthesizing the red blood cell image; thecombined result is obtained by using a K-means clustering algorithm togenerate a plurality of clusters from the training results and the redblood cell shape data set; the style of synthesizing the red blood cellimage is determined by the feature encoder network E based on randomlycollected features of the plurality of clusters; inputting the pluralityof masks into the generator at a stage of synthesizing the red bloodcell image; and synthesizing, by the generator, the plurality of masksinto the red blood cell image.
 26. The computer-readable storage mediumaccording to claim 25, wherein when the computer instruction runs on thecomputer, the computer is enabled to execute a complete network trainingtarget, and the complete network training target is as follows:${\min\limits_{G}\left( {\left( {\max\limits_{D_{1},D_{2}}{\sum\limits_{{k = 1},2}{L_{GAN}\left( {G,D_{k}} \right)}}} \right) + {\lambda_{FM}{\sum\limits_{{k = 1},2}{L_{FM}\left( {G,D_{k}} \right)}}} + {\lambda_{PR}{L_{PR}\left( {{G\left( {x,{E(x)}} \right)},y} \right)}}} \right)},$wherein, x represents the red blood cell shape data set,L_(GAN)(G,D_(k)) represents an adversarial loss, and an expression ofthe adversarial loss is as follows:E _((x,y))[log D _(k)(x,y)]+E _(x)[log(1−D _(k)(x,G(x,E(x)))] wherein,L_(FM)(G,D_(k)) represents a feature matching loss, the feature matchingloss is used to stabilize the training results and compensate visuallygenerated results on a plurality of scales, and an expression of thefeature matching loss is as follows:${E_{({x,y})}{\sum\limits_{i = 1}^{T}{\frac{1}{N_{i}}\left\lbrack {{{{D_{k}^{(i)}\left( {x,y} \right)} - {D_{k}^{(i)}\left( {x,{G\left( {x,{E(x)}} \right)}} \right)}}}1} \right\rbrack}}},$wherein, L_(PR)(G(x,E(x)),y) represents a perceptual reconstructionloss, and an expression of the perceptual reconstruction loss is asfollows:$\sum\limits_{i = 1}^{N}{{\frac{1}{M_{i}}\left\lbrack {{{{F^{(i)}(y)} - {F^{(i)}\left( {x,{G\left( {x,{E(x)}} \right)}} \right)}}}1} \right\rbrack}.}$